from autodiff_test import *

if __name__ == "__main__":
    x2 = ad.Variable(name='x2')
    y = 3 - x2
    grad_x2, = ad.gradients(y, [x2])
    executor = ad.Executor([y, grad_x2])
    x2_val = 2 * np.ones(3)
    y_val, grad_x2_val= executor.run(feed_dict = {x2 : x2_val})


    ad.print_topo_sort(ad.find_topo_sort([y]))